﻿/*
 * @author: wizardc
 */

using System.Net.Sockets;

namespace Dou.Net
{
    /// <summary>
    /// 套接字解包对象的接口
    /// </summary>
    public interface IPacketParser
    {
        /// <summary>
        /// 连接是否断开
        /// </summary>
        bool isConnectClosed { get; }

        /// <summary>
        /// 接收服务端发送的数据
        /// </summary>
        /// <param name="socket">套接字对象</param>
        /// <returns>是否已经解码好一个包</returns>
        bool ReceiveData(Socket socket);

        /// <summary>
        /// 获取可以使用的数据包
        /// </summary>
        byte[] GetPacket();
    }
}
